home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 43 / Amiga Format CD43 (1999)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1999-09].iso / -serious- / comms / other / aminetparse / addaminet.thor next >
Text File  |  1999-06-14  |  2KB  |  68 lines

  1. /*
  2. $VER: AddAminet.thor 1.1 (19.9.97)
  3. by Neil Bothwick
  4. */
  5. /* Adds Aminet INDEX or RECENT files to file database              */
  6. /* using AminetParse by Daniel J. Andrea II <dandrea@unix.tfs.net> */
  7. /* AminetParse must be in the thor/bin directory                   */
  8.  
  9. options results
  10.  
  11. /* ;;;Needs THOR and bbsread.library functions */
  12. thorport = address()
  13. if left(thorport,5) ~= 'THOR.' then do
  14.     say 'Addaminet.thor must be run from within Thor.'
  15.     exit
  16.     end
  17.  
  18. if ~show('p', 'BBSREAD') then do
  19.     address command
  20.     'run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead'
  21.     'WaitForPort BBSREAD'
  22.     end
  23. ;;;
  24. /* ;;;Get current system name and directory */
  25. address(thorport)
  26. drop TMP.
  27. 'CURRENTSYSTEM stem TMP'
  28. System = TMP.BBSNAME
  29. address 'BBSREAD'
  30. drop TMP.
  31. 'GETBBSDATA "'system'" stem TMP'
  32. SystemDir = TMP.BBSPATH
  33. call open('env','ENV:THOR/THORPath','R');ProgDir = readln('env');call close('env')
  34. ;;;
  35. /* ;;;Select INDEX file */
  36. address(thorport)
  37. 'REQUESTFILE TITLE "Select INDEX or RECENT file" ID "" PAT #? FP'
  38. if RC=5 then exit
  39. if RC > 0 then do
  40.     'REQUESTNOTIFY TEXT "'THOR.LASTERROR'" BT " OK "'
  41.     exit
  42.     end
  43. Index = result
  44. ;;;
  45. /* ;;;Offer to delete old filebase */
  46. if (pos('INDEX',upper(Index)) > 0) & (exists(SystemDir'File.tags') > 0) then do
  47.     'REQUESTNOTIFY TEXT "This appears to be a complete Aminet index.\nDo you want to clear the file database first?" BT "Yes|No|Cancel"'
  48.     if result = 0 then exit
  49.     if result = 1 then do
  50.         if exists(ProgDir'Rexx/BBSRead/ClearFileDataBase.br') then address command 'rx' ProgDir'Rexx/BBSRead/ClearFileDataBase.br' System
  51.         else 'REQUESTNOTIFY TEXT "Rexx/BBSRead/ClearFileDataBase.br\nnot found in Thor path" BT " OK "'
  52.         end
  53.     end
  54. ;;;
  55. /* ;;; Option to use SortMail.excl if present */
  56. exclude = ''
  57. if exists(SystemDir'Sortmail.excl') then do
  58.     'REQUESTNOTIFY "Do you want to use the filters in your Sortmail.excl file?" BT "Yes|No|Cancel"'
  59.     if result = 0 then exit
  60.     if result = 1 then exclude = 'EXCLUDE'
  61.     end
  62. ;;;
  63. /* ;;;Add INDEX to database */
  64. address command 'bin/AminetParse "'System'" "'Index'"' exclude
  65. ;;;
  66.  
  67.  
  68.